﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using Bewise.SmartIndexManager.Core.Classes.Database;
using Bewise.SmartIndexManager.Core.Classes.Options;
using Bewise.SmartIndexManager.Core.Classes.Instance;
using Bewise.SmartIndexManager.Core.Classes.Types;
using System.ComponentModel;
using System.Xml.Serialization;

namespace Bewise.SmartIndexManager.Core
{
public class TaskInfosContainer : INotifyPropertyChanged
{
    public TaskInfosContainer()
    {
        ConnectionString = string.Empty;
        Options = new List<AbstractOption>();
        InstanceInfos = new InstanceInfos();
    }

    public void InitOptions()
    {
        Options = AbstractOption.GetListOptions();
    }

    // Chaine de connexion issue
    public string ConnectionString { get; set; }
    public InstanceInfos InstanceInfos { get; set; }
    public List<AbstractOption> Options { get; set; }
    public bool LogOnInformationIsEnabled { get; set; }

    [XmlIgnore]
    public DatabasesTypeEnum SelectedDatabases
    {
        get { return InstanceInfos.SelectedDatabases; }
        set
        {
            InstanceInfos.SelectedDatabases = value;
            // notification d'un changement de valeur
            PropertyChanged(this, new PropertyChangedEventArgs("SelectedDatabases"));
        }
    }


    public event PropertyChangedEventHandler PropertyChanged;
}
}
